home *** CD-ROM | disk | FTP | other *** search
/ Quick PC 61 / Quick PC 61.iso / I386 / WMS.CAB / WMSCommon.js < prev    next >
Encoding:
JavaScript  |  2003-02-21  |  23.0 KB  |  973 lines

  1. /*-------------------------------------------------------------------------
  2. '
  3. '  Microsoft Windows Media
  4. '  Copyright (C) Microsoft Corporation. All rights reserved.
  5. '
  6. '  File:       WMSCommon.js
  7. '
  8. '  Contents:    Included by nearly all WMS Admin .asp files
  9. '
  10. '--------------------------------------------------------------------------*/
  11.  
  12. /*@cc_on @*/
  13.  
  14. var g_dwLastTimerTask = 0;
  15. var g_rgDivVisited = null;
  16. var g_dwNumHelpLoadAttempts = 0;
  17. var g_bDisplayingError = false;
  18. var g_bDebugMode = false;
  19. var g_winHelp = null;
  20.  
  21. var g_bMSIE, g_bNetscape, g_bOpera;
  22. g_bMSIE = ( -1 != window.navigator.appName.indexOf( "IE" ) ) || ( -1 != window.navigator.appName.indexOf( "Microsoft" ) );
  23. g_bNetscape = ( -1 != window.navigator.appName.indexOf( "Netscape" ) );
  24. g_bOpera = ( -1 != window.navigator.appName.indexOf( "Opera" ) );
  25.  
  26. window.status = "";
  27.  
  28. if( true == g_bMSIE )
  29. {
  30.     window.onerror=fnErrHandler;
  31. }
  32. else if( true == g_bNetscape )
  33. {
  34.     document.onmouseup=void( 0 );
  35. }
  36.  
  37. ///////////////////////////
  38. function fnErrHandler( sMsg, sUrl, sLine )
  39. {
  40. /*@if (@_jscript_version >= 1.3)
  41.     try 
  42.     {
  43. @end @*/
  44.         if( g_bDebugMode )
  45.         {
  46.             if( g_bDisplayingError )
  47.             {
  48.                 return( true );
  49.             }
  50.             
  51.             g_bDisplayingError = true;
  52.             window.alert( "Windows Media Services\n\nError: " + sMsg + "\nPage: " + sUrl + "\nLine: " + sLine );
  53.             g_bDisplayingError = false;
  54.         }
  55.         return( true );
  56. /*@if (@_jscript_version >= 1.3)
  57.     } 
  58.     catch( error )
  59.     {
  60.         if( g_bDebugMode ) { throw( error ); }
  61.     }
  62. @end @*/
  63. }
  64.  
  65. ///////////////////////////
  66. function RemoveBad( szTemp )
  67. {
  68. /*@if (@_jscript_version >= 1.3)
  69.     try 
  70.     {
  71. @end @*/
  72.         var szSafeString = new String( szTemp );
  73.         szSafeString = szTemp.replace( /\<|\>|\"|\%|\;|\(|\)|\&|\+|\-/g, "" );
  74.         return( szSafeString );
  75. /*@if (@_jscript_version >= 1.3)
  76.     } 
  77.     catch( error )
  78.     {
  79.         if( g_bDebugMode ) { throw( error ); }
  80.     }
  81. @end @*/
  82. }
  83.  
  84. ///////////////////////////
  85. function EscapeTheBackslashCharacter( szUnfiltered )
  86. {
  87. /*@if (@_jscript_version >= 1.3)
  88.     try 
  89.     {
  90. @end @*/
  91.         var szSafe = new String( szUnfiltered );
  92.         szSafe = szUnfiltered.replace( /\\&/g, "\\" );
  93.         return( szSafe );
  94. /*@if (@_jscript_version >= 1.3)
  95.     } 
  96.     catch( error )
  97.     {
  98.         if( g_bDebugMode ) { throw( error ); }
  99.     }
  100. @end @*/
  101. }
  102.  
  103. ///////////////////////////
  104. function RemoveDangerousCharacters( szUnfiltered )
  105. {
  106. /*@if (@_jscript_version >= 1.3)
  107.     try 
  108.     {
  109. @end @*/
  110.         var szSafe = new String( szUnfiltered );
  111.         var re = /\<|\>|\*|\%|\;|\(|\)|\"|\u201C|\u201D|\u201E|\"\&/gim;
  112.         szSafe = szUnfiltered.replace( re, "" );
  113.         return( szSafe );
  114. /*@if (@_jscript_version >= 1.3)
  115.     } 
  116.     catch( error )
  117.     {
  118.         if( g_bDebugMode ) { throw( error ); }
  119.     }
  120. @end @*/
  121. }
  122.  
  123. ///////////////////////////
  124. function ShowHideSecureWarning( szPathToImg, szWarningText )
  125. {
  126. /*@if (@_jscript_version >= 1.3)
  127.     try 
  128.     {
  129. @end @*/
  130.         if( parent.frames && parent.frames[ "treeFrames" ] && parent.frames && parent.frames[ "treeFrames" ].frames[ "frameTreeCode" ] )
  131.         {
  132.             return;
  133.         }
  134.         document.write( "<td align=left valign=top>" );
  135.         document.write( "<a href=\"" + document.location.protocol + "//" + parent.document.location.host + "/nonsecure.asp" + "\" target=\"sList\" style=\"position:absolute;right:15;top:10\" border=0><img alt=\"" + szWarningText + "\" border=0 height=32 width=32 src=" + szPathToImg + " ></a>" );
  136.         document.write( "</td> " );
  137. /*@if (@_jscript_version >= 1.3)
  138.     } 
  139.     catch( error )
  140.     {
  141.         if( g_bDebugMode ) { throw( error ); }
  142.     }
  143. @end @*/
  144. }
  145.  
  146. ///////////////////////////
  147. function SafeUnescape( szInput )
  148. {
  149.     var szRetVal;
  150. /*@if (@_jscript_version >= 1.3)
  151.     try 
  152.     {
  153. @end @*/
  154.         szRetVal = new String( szInput );
  155.         if( 0 == szRetVal.length )
  156.         {
  157.             return( "" );
  158.         }
  159.     /*@if (@_jscript_version >= 5.5)
  160.         szRetVal = decodeURIComponent( szRetVal );
  161.        @else @*/
  162.         szRetVal = unescape( szRetVal );
  163.     /*@end @*/
  164. /*@if (@_jscript_version >= 1.3)
  165.     } 
  166.     catch( error )
  167.     {
  168.         if( g_bDebugMode ) { throw( error ); }
  169.     }
  170. @end @*/
  171.     return( szRetVal );
  172. }
  173.  
  174. ///////////////////////////
  175. function SafeEscape( szInput )
  176. {
  177.     var szRetVal;
  178.     var szUnescapedVal;
  179. /*@if (@_jscript_version >= 1.3)
  180.     try 
  181.     {
  182. @end @*/
  183.         szRetVal = new String( szInput );
  184.         if( 0 == szRetVal.length )
  185.         {
  186.             return( "" );
  187.         }
  188.         
  189.         // prevent dbl-escape bugs
  190.         szUnescapedVal = SafeUnescape( szInput );
  191.         if( szUnescapedVal != szInput )
  192.         {
  193.             return( szInput );
  194.         }
  195. /*@if (@_jscript_version >= 5.5)
  196.     szRetVal = encodeURIComponent( szRetVal );
  197.    @else @*/
  198.     szRetVal = escape( szRetVal );
  199. /*@end @*/
  200. /*@if (@_jscript_version >= 1.3)
  201.     } 
  202.     catch( error )
  203.     {
  204.         if( g_bDebugMode ) { throw( error ); }
  205.     }
  206. @end @*/
  207.     return( szRetVal );
  208. }
  209.  
  210. ///////////////////////////
  211. function FileFromPath( szPath )
  212. {
  213.     var dwLastPosOfSlash = 0;
  214.     var dwPosOfSlash = 0;
  215.     var szPathStr = new String( szPath );
  216.     dwPosOfSlash = szPathStr.lastIndexOf( "/" );
  217.     return( szPathStr.slice( dwPosOfSlash + 1 ) );
  218. }
  219.  
  220. ///////////////////////////
  221. function EatHelpCookie( szTopic )
  222. {
  223. /*@if (@_jscript_version >= 1.3)
  224.     try 
  225.     {
  226. @end @*/
  227.         var cookieParent = null;
  228.         if( ( null == g_winHelp ) || ( 2 > g_winHelp.frames.length ) )
  229.         {
  230.             return;
  231. //            cookieParent = window.document;
  232.         }
  233.         else
  234.         {
  235.             cookieParent = g_winHelp.document;
  236.         }
  237.     
  238.         var expiredDate = new Date();
  239.         expiredDate.setMinutes( expiredDate.getMinutes() - 2 );
  240.         
  241.         var szCurrentTopic = document.location.protocol + "//" + document.location.hostname + ":" + document.location.port + szTopic;
  242.         cookieParent.cookie = "helpTreeActiveTopic=; expires=" + expiredDate.toUTCString() + "; secure=false;";
  243.         cookieParent.cookie = "helpTreeActiveURL=; expires=" + expiredDate.toUTCString() + "; secure=false;";
  244. //        cookieParent.cookie = "helpTreeOpenNodes=; expires=" + expiredDate.toUTCString() + "; secure=false;";
  245.  
  246.         var newDate = new Date();
  247.         newDate.setUTCDate( newDate.getUTCMinutes() + 15 );
  248.         cookieParent.cookie = "helpTreeActiveURL=" + szTopic + "; expires=" + newDate.toUTCString() + ";";
  249.  
  250. /*@if (@_jscript_version >= 1.3)
  251.     } 
  252.     catch( error )
  253.     {
  254.         if( g_bDebugMode ) { throw( error ); }
  255.     }
  256. @end @*/
  257. }
  258.  
  259. ///////////////////////////
  260. function LoadHelpTopic( szTopic )
  261. {
  262. /*@if (@_jscript_version >= 1.3)
  263.     try 
  264.     {
  265. @end @*/        
  266.         if( null == g_winHelp )
  267.         {
  268.             return;
  269.         }
  270.         
  271.         var dwNumFrames = 0;
  272.         var mainFrame = null;
  273.         dwNumFrames = g_winHelp.frames.length;
  274.         mainFrame = g_winHelp.frames[ "main" ];
  275.  
  276.         if( ! mainFrame )
  277.         {
  278.             if( g_dwNumHelpLoadAttempts < 3 )
  279.             {
  280.                 g_dwNumHelpLoadAttempts = g_dwNumHelpLoadAttempts + 1;
  281.                 
  282.                 var szOperation = "LoadHelpTopic( " + "'" + szTopic + "'" + ");";
  283.                 setTimeout( szOperation, 500, "JavaScript" );
  284.             }            
  285.             return;
  286.         }
  287.         
  288.         mainFrame.location.replace( szTopic );
  289.     
  290.         if( FileFromPath ( mainFrame.location.pathname ) != FileFromPath ( szTopic ) )
  291.         {
  292.             if( "default.htm" == FileFromPath ( mainFrame.location.pathname ) )
  293.             {
  294.                 mainFrame.location.replace( szTopic );
  295.             }
  296.             else
  297.             {
  298.                 mainFrame.location = szTopic;
  299.             }
  300.             
  301.             var szOperation = "LoadHelpTopic( " + "'" + szTopic + "'" + ");";
  302.             setTimeout( szOperation, 400, "JavaScript" );
  303.         }
  304.         else
  305.         {
  306.             if( true == g_bMSIE )
  307.             {
  308.                 if( mainFrame.SynchToc )
  309.                 {
  310.                     mainFrame.SynchToc();
  311.                 }
  312.             }
  313.         }
  314. /*@if (@_jscript_version >= 1.3)
  315.     } 
  316.     catch( error )
  317.     {
  318.         if( g_bDebugMode ) { throw( error ); }
  319.     }
  320. @end @*/
  321. }
  322.  
  323. ///////////////////////////
  324. function DoHelp( szNesting, szTopic )
  325. {
  326. /*@if (@_jscript_version >= 1.3)
  327.     try 
  328.     {
  329. @end @*/        
  330.         if( document.pluginForm && document.pluginForm.help )
  331.         {
  332.             document.pluginForm.help.disabled = true;
  333.         }
  334.         
  335.         var szFeatures = "location,hotkeys,scrollbars,status,resizable,menubar,toolbar";
  336.         var szBaseHelpURL = szNesting;
  337.         
  338.         g_winHelp = window.open( "", "HELP", szFeatures, false );
  339.         EatHelpCookie( szTopic );
  340.  
  341.         var bReload = false;
  342.         
  343.         if( true == g_bMSIE )
  344.         {
  345.             if( ( null == g_winHelp ) || 
  346.                 ( 3 != g_winHelp.frames.length ) || 
  347.                 ( null == g_winHelp.frames[ "treebody" ] ) ||
  348.                 ( null == g_winHelp.frames[ "treesrc" ] ) ||
  349.                 ( null == g_winHelp.frames[ "main" ] ) )
  350.             {
  351.                 bReload = true;
  352.             }
  353.         }
  354.         else 
  355.         {
  356.             if( ( null == g_winHelp ) || 
  357.                 ( 2 != g_winHelp.frames.length ) || 
  358.                 ( null == g_winHelp.frames[ "main" ] ) )
  359.             {
  360.                 bReload = true;
  361.             }
  362.         }
  363.         if( bReload )
  364.         {
  365.             g_winHelp = window.open( szNesting + "help/default.htm", "HELP", szFeatures, false );
  366.         }
  367.         if( g_winHelp )
  368.         {
  369.             EatHelpCookie( szTopic );
  370. //            g_winHelp.document.SetDefaultOpenTreeNodes();
  371. //            g_winHelp.document.InitTree();
  372.  
  373.             g_winHelp.name = "HELP";
  374.             g_winHelp.focus();
  375.  
  376.             LoadHelpTopic( szTopic );
  377.             
  378.             if( document.pluginForm && document.pluginForm.help )
  379.             {
  380.                 document.pluginForm.help.disabled = false;
  381.             }
  382.         }
  383. /*@if (@_jscript_version >= 1.3)
  384.     } 
  385.     catch( error )
  386.     {
  387.         if( g_bDebugMode ) { throw( error ); }
  388.     }
  389. @end @*/
  390. }
  391.  
  392. ///////////////////////////
  393. function DoPluginHelp()
  394. {
  395. /*@if (@_jscript_version >= 1.3)
  396.     try 
  397.     {
  398. @end @*/
  399.         var szFeatures = "location,hotkeys,scrollbars,status,resizable,menubar,toolbar";
  400.  
  401.         g_winHelp = window.open( "../../help/default.htm", "HELP", szFeatures, false );
  402.         if( g_winHelp )
  403.         {
  404.             g_winHelp.name = "HELP";
  405.             g_winHelp.focus();
  406.         }
  407. /*@if (@_jscript_version >= 1.3)
  408.     } 
  409.     catch( error )
  410.     {
  411.         if( g_bDebugMode ) { throw( error ); }
  412.     }
  413. @end @*/
  414. }
  415.  
  416. ///////////////////////////
  417. function ShowServerList()
  418. {
  419. /*@if (@_jscript_version >= 1.3)
  420.     try 
  421.     {
  422. @end @*/
  423.         window.open( "/wmssecure/index.asp?show=true", "sList", "hotkeys,scrollbars,status,menubar,resizable", true );
  424. /*@if (@_jscript_version >= 1.3)
  425.     } 
  426.     catch( error )
  427.     {
  428.         if( g_bDebugMode ) { throw( error ); }
  429.     }
  430. @end @*/
  431. }
  432.  
  433. ///////////////////////////
  434. function DoRefresh()
  435. {
  436.     var eachChildFrame;
  437.     var numFrames;
  438.     var childFrame;
  439.     var bUpdatesPerformed;
  440.  
  441. /*@if (@_jscript_version >= 1.3)
  442.     try 
  443.     {
  444. @end @*/
  445.         bUpdatesPerformed = false;
  446.         
  447.         childFrame = parent.frames && parent.frames[ "treeFrames" ];
  448.         if( childFrame )
  449.         {
  450.             childFrame = window.parent.frames[ "treeFrames" ].frames[ "frameTreeCode" ];
  451.         }
  452.         if( childFrame )
  453.         {
  454.             childFrame.location.replace( childFrame.location );
  455.             bUpdatesPerformed = true;
  456.         }
  457.  
  458.         childFrame = window.parent.frames[ "frameDetails" ];
  459.         if( childFrame )
  460.         {
  461.             childFrame.location.replace( childFrame.location );
  462.             bUpdatesPerformed = true;
  463.         }
  464.         
  465.         childFrame = window.top.frames[ "WMSSession" ];
  466.         if( childFrame )
  467.         {
  468.             childFrame.location = childFrame.location;
  469.             bUpdatesPerformed = true;
  470.         }
  471.  
  472.         if( bUpdatesPerformed )
  473.         {
  474.             return;
  475.         }
  476.             
  477.         eachChildFrame = 0;
  478.         if ( window.parent )
  479.         {
  480.             numFrames = window.parent.frames.length;
  481.         }
  482.         else
  483.         {
  484.             numFrames = window.frames.length;
  485.         }
  486.  
  487.         if( 0 < numFrames )
  488.         {
  489.             for( eachChildFrame = 0; eachChildFrame < numFrames; eachChildFrame++ )
  490.             {
  491.                 if( window.parent )
  492.                 {
  493.                     childFrame = window.parent.frames[ eachChildFrame ];
  494.                 }
  495.                 else
  496.                 {
  497.                     childFrame = window.frames[ eachChildFrame ];
  498.                 }
  499.                 
  500.                 if( childFrame )
  501.                 {
  502.                     if( childFrame.location )
  503.                     {
  504.                         childFrame.location.replace( childFrame.location );
  505.                     }
  506.                 }
  507.             }
  508.         }
  509.         else
  510.         {
  511.             if( 0 != g_dwLastTimerTask )
  512.             {
  513.                 window.clearTimeout( g_dwLastTimerTask );
  514.                 g_dwLastTimerTask = 0;
  515.             }
  516.             document.location.replace( document.location );
  517.         }
  518. /*@if (@_jscript_version >= 1.3)
  519.     } 
  520.     catch( error )
  521.     {
  522.         if( g_bDebugMode ) { throw( error ); }
  523.     }
  524. @end @*/
  525. }
  526.  
  527. ///////////////////////////
  528. function UpdateTreeView()
  529. {
  530. /*@if (@_jscript_version >= 1.3)
  531.     try 
  532.     {
  533. @end @*/
  534.         var eachChildFrame;
  535.         var numFrames;
  536.         var childFrame;
  537.         if( window.parent && window.parent.frames && window.parent.frames[ "treeFrames" ] && window.parent.frames[ "treeFrames" ].frames )
  538.         {
  539.             childFrame = window.parent.frames[ "treeFrames" ].frames[ "frameTreeCode" ];
  540.         }
  541.  
  542.         if( childFrame )
  543.         {
  544.             childFrame.location.replace( childFrame.location );
  545.         }        
  546. /*@if (@_jscript_version >= 1.3)
  547.     } 
  548.     catch( error )
  549.     {
  550.         if( g_bDebugMode ) { throw( error ); }
  551.     }
  552. @end @*/
  553. }
  554.  
  555.  
  556. ///////////////////////////
  557. function SetRefreshRate( caller )
  558. {
  559. /*@if (@_jscript_version >= 1.3)
  560.     try 
  561.     {
  562. @end @*/
  563.         if( document.RefreshInterval )
  564.         {
  565.             document.RefreshInterval.submit();
  566.         }
  567.         else
  568.         {
  569.             caller.submit();
  570.         }
  571. /*@if (@_jscript_version >= 1.3)
  572.     } 
  573.     catch( error )
  574.     {
  575.         if( g_bDebugMode ) { throw( error ); }
  576.     }
  577. @end @*/
  578. }
  579.  
  580. g_rgDivVisited = null;  //new Array( 0 );
  581.  
  582. ///////////////////////////
  583. function InArrayAtIndex( theDiv )
  584. {
  585. /*@if (@_jscript_version >= 1.3)
  586.     try 
  587.     {
  588. @end @*/
  589.         var i, len, element, szID_A, szID_B;
  590.         len = g_rgDivVisited.length;
  591.         
  592.         if( ( null == g_rgDivVisited ) || ( null == theDiv ) )
  593.         {
  594.             return( -1 );
  595.         }
  596.         
  597.         szID_A = new String( theDiv.id );
  598.                 
  599.         for( i = 0; i < len; i++ )
  600.         {
  601.             element = g_rgDivVisited[ i ];
  602.             if( null != element )
  603.             {
  604.                 szID_B = element.id;
  605.                 if( szID_A == szID_B )
  606.                 {
  607.                     return( i );
  608.                 }
  609.             }
  610.         }
  611. /*@if (@_jscript_version >= 1.3)
  612.     } 
  613.     catch( error )
  614.     {
  615.         if( g_bDebugMode ) { throw( error ); }
  616.     }
  617. @end @*/
  618.     return( -1 );
  619. }
  620.  
  621. ///////////////////////////
  622. function RecordMouseOverInArray( szName )
  623. {
  624.     if( ! g_bMSIE )
  625.     {
  626.         return;
  627.     }
  628.  
  629. /*@if (@_jscript_version >= 1.3)
  630.     try 
  631.     {
  632. @end @*/
  633.         var theDiv = document.all[ szName ];
  634.         if( ! theDiv )
  635.         {
  636.             return;
  637.         }
  638.             
  639.         if( ! g_rgDivVisited )
  640.         {
  641.             g_rgDivVisited = new Array( theDiv );
  642.         }
  643.         else
  644.         {
  645.             if( -1 == InArrayAtIndex( theDiv ) )
  646.             {
  647.                 g_rgDivVisited[ g_rgDivVisited.length ] = theDiv;
  648.     //          DumpIDsInArray();
  649.             }
  650.             RestoreAllButThis( szName );
  651.         }
  652. /*@if (@_jscript_version >= 1.3)
  653.     } 
  654.     catch( error )
  655.     {
  656.         if( g_bDebugMode ) { throw( error ); }
  657.     }
  658. @end @*/
  659.     return;
  660. }
  661.  
  662. ///////////////////////////
  663. function OnMouseLeave( dwWhichItem, szName )
  664. {
  665.     if( ! g_bMSIE )
  666.     {
  667.         return;
  668.     }
  669.  
  670. /*@if (@_jscript_version >= 1.3)
  671.     try 
  672.     {
  673. @end @*/
  674.         var theDiv = document.all[ szName ];
  675.         if( ! theDiv )
  676.         {
  677.             return;
  678.         }
  679.     
  680.         ResetToolbarEntry( szName );
  681.         theDiv.releaseCapture();
  682. /*@if (@_jscript_version >= 1.3)
  683.     } 
  684.     catch( error )
  685.     {
  686.         if( g_bDebugMode ) { throw( error ); }
  687.     }
  688. @end @*/
  689.     return;
  690. }
  691.  
  692. ///////////////////////////
  693. function OnMouseDown( dwWhichItem, szName )
  694. {
  695.     if( ! g_bMSIE )
  696.     {
  697.         return;
  698.     }
  699.  
  700. /*@if (@_jscript_version >= 1.3)
  701.     try 
  702.     {
  703. @end @*/
  704.         var theDiv = document.all[ szName ];
  705.         if( ! theDiv )
  706.         {
  707.             return;
  708.         }
  709.         
  710.         RecordMouseOverInArray( szName );
  711.         theDiv.setCapture();
  712.  
  713.         var szOuterHTML = new String( theDiv.outerHTML );
  714.         if( -1 != szOuterHTML.indexOf( "toolbarnormal" ) )
  715.         {
  716. /*
  717.             if( theDiv.className != "toolbardepressed" )
  718.             {
  719.                 theDiv.className = "toolbardepressed";
  720.             }
  721. */
  722.         }
  723. /*@if (@_jscript_version >= 1.3)
  724.     } 
  725.     catch( error )
  726.     {
  727.         if( g_bDebugMode ) { throw( error ); }
  728.     }
  729. @end @*/
  730.     return;
  731. }
  732.  
  733. ///////////////////////////
  734. function OnMouseUp( dwWhichItem, szName )
  735. {
  736.     if( ! g_bMSIE )
  737.     {
  738.         return;
  739.     }
  740.  
  741. /*@if (@_jscript_version >= 1.3)
  742.     try 
  743.     {
  744. @end @*/
  745.         var theDiv = document.all[ szName ];
  746.         if( ! theDiv )
  747.         {
  748.             return;
  749.         }
  750.         
  751.         RecordMouseOverInArray( szName );
  752.         theDiv.setCapture();
  753.  
  754.         var szOuterHTML = new String( theDiv.outerHTML );
  755.         if( -1 != szOuterHTML.indexOf( "toolbarnormal" ) )
  756.         {
  757.             theDiv.style.backgroundColor = "white";
  758.             if( theDiv.className != "toolbarnormal" )
  759.             {
  760.                 theDiv.className = "toolbarnormal";
  761.             }
  762.         }
  763. /*@if (@_jscript_version >= 1.3)
  764.     } 
  765.     catch( error )
  766.     {
  767.         if( g_bDebugMode ) { throw( error ); }
  768.     }
  769. @end @*/
  770.     return;
  771. }
  772.  
  773. ///////////////////////////
  774. function OnMouseEnter( dwWhichItem, szName )
  775. {
  776.     if( ! g_bMSIE )
  777.     {
  778.         return;
  779.     }
  780.  
  781. /*@if (@_jscript_version >= 1.3)
  782.     try 
  783.     {
  784. @end @*/
  785.         var theDiv = document.all[ szName ];
  786.         if( ! theDiv )
  787.         {
  788.             return;
  789.         }
  790.         
  791.         RecordMouseOverInArray( szName );
  792.         theDiv.setCapture();
  793.  
  794.         var szOuterHTML = new String( theDiv.outerHTML );
  795.         if( -1 != szOuterHTML.indexOf( "toolbarnormal" ) )
  796.         {
  797.             if( theDiv.className != "toolbarhover" )
  798.             {
  799.                 theDiv.className = "toolbarhover";
  800.             }
  801.         }
  802. /*@if (@_jscript_version >= 1.3)
  803.     } 
  804.     catch( error )
  805.     {
  806.         if( g_bDebugMode ) { throw( error ); }
  807.     }
  808. @end @*/
  809.     return;
  810. }
  811.  
  812. ///////////////////////////
  813. function OnClickToolbar( dwWhichItem, szName, szLinkName )
  814. {
  815.     if( ! g_bMSIE )
  816.     {
  817.         return;
  818.     }
  819.  
  820. /*@if (@_jscript_version >= 1.3)
  821.     try 
  822.     {
  823. @end @*/
  824.         var theLink = document.all[ szLinkName ];
  825.         if( theLink )
  826.         {
  827.             theLink.click();
  828.         }
  829.         
  830.         var theDiv = document.all[ szName ];
  831.         if( theDiv )
  832.         {
  833.             if( theDiv.className != "toolbarnormal" )
  834.             {
  835.                 theDiv.className = "toolbarnormal";
  836.             }
  837.         }
  838. /*@if (@_jscript_version >= 1.3)
  839.     } 
  840.     catch( error )
  841.     {
  842.         if( g_bDebugMode ) { throw( error ); }
  843.     }
  844. @end @*/
  845.     return;
  846. }
  847.  
  848. ///////////////////////////
  849. function ResetToolbarEntry( dwWhichItem, szName )
  850. {
  851.     if( ! g_bMSIE )
  852.     {
  853.         return;
  854.     }
  855.  
  856. /*@if (@_jscript_version >= 1.3)
  857.     try 
  858.     {
  859. @end @*/
  860.         var theDiv = document.all[ szName ];
  861.         if( ! theDiv )
  862.         {
  863.             return;
  864.         }
  865.  
  866.         var szOuterHTML = new String( theDiv.outerHTML );
  867.         if( -1 != szOuterHTML.indexOf( "toolbarhover" ) )
  868.         {
  869.             if( theDiv.className != "toolbarnormal" )
  870.             {
  871.                 theDiv.className = "toolbarnormal";
  872.             }
  873.  
  874.             var i = InArrayAtIndex( theDiv );
  875.             if( -1 != i )
  876.             {
  877.                 if( 0 < i )
  878.                 {
  879.                     var rgA, rgB;
  880.                     rgA = g_rgDivVisited.slice( 0, i-1 );
  881.                     rgB = g_rgDivVisited.slice( i+1, g_rgDivVisited.length );
  882.                     g_rgDivVisited = rgA.concat( rgB );
  883.                 }
  884.                 else
  885.                 {
  886.                     g_rgDivVisited = g_rgDivVisited.slice( i + 1, g_rgDivVisited.length );
  887.                 }
  888.             }
  889.         }
  890. /*@if (@_jscript_version >= 1.3)
  891.     } 
  892.     catch( error )
  893.     {
  894.         if( g_bDebugMode ) { throw( error ); }
  895.     }
  896. @end @*/
  897.     return;
  898. }
  899.  
  900. ///////////////////////////
  901. // useful for debugging toolbar array
  902. //
  903. function DumpIDsInArray()
  904. {
  905. /*@if (@_jscript_version >= 1.3)
  906.     try 
  907.     {
  908. @end @*/
  909.         var szVisited = new String( "visited: " );
  910.         for( i = 0; i < g_rgDivVisited.length; i++ )
  911.         {
  912.             var objElement = g_rgDivVisited[ i ];
  913.             szVisited += objElement.name
  914.         }
  915.         window.status = szVisited;
  916. /*@if (@_jscript_version >= 1.3)
  917.     } 
  918.     catch( error )
  919.     {
  920.         if( g_bDebugMode ) { throw( error ); }
  921.     }
  922. @end @*/
  923.     return;
  924. }
  925.  
  926.  
  927. ///////////////////////////
  928. function RestoreAllButThis( szName )
  929. {
  930.     if( ! g_bMSIE )
  931.     {
  932.         return;
  933.     }
  934.  
  935. /*@if (@_jscript_version >= 1.3)
  936.     try 
  937.     {
  938. @end @*/
  939.         var theDiv = document.all[ szName ];
  940.         var i, len;
  941.         var szID_A, szID_B;
  942.         var objElement;
  943.  
  944.         if( ! g_rgDivVisited || ! theDiv )
  945.         {
  946.             return;
  947.         }
  948.  
  949.         szID_A = new String( theDiv.id );
  950.  
  951.         len = g_rgDivVisited.length;
  952.         for( i = 0; i < len; i++ )
  953.         {
  954.             objElement = g_rgDivVisited[ i ];
  955.             
  956.             if( objElement ) 
  957.             {
  958.                 szID_B = new String( objElement.id );
  959.                 if( szID_A != objElement.id )
  960.                 {
  961.                     ResetToolbarEntry( szID_B );
  962.                 }
  963.             }
  964.         }
  965. /*@if (@_jscript_version >= 1.3)
  966.     } 
  967.     catch( error )
  968.     {
  969.         if( g_bDebugMode ) { throw( error ); }
  970.     }
  971. @end @*/
  972. }
  973.